package producerAndConsumer;

/**
 * <pre>
 * 功能描述：
 * </pre>
 *
 * @author: 李明杰
 * @date: 2023/4/29 16:38
 */
public class Consumer extends Thread {

    public void run() {
        while (!this.isInterrupted()) {
            try {
                String result = Container.arrayBlockingQueue.take();//有数据就消费，没有就阻塞等待
                System.out.println(result);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
